<!DOCTYPE HTML>
<html>
<head>
    <title>Environment-越努力，越幸运！Scott Jeremy的个人博客，将由互联网学到的知识回馈给互联网</title>
    <link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
    <!-- jQuery (necessary JavaScript plugins) -->
    <script src="js/jquery.min.js"></script>
    <!-- Custom Theme files -->
    <link href="css/dashboard.css" rel="stylesheet">
    <link href="css/style.css" rel='stylesheet' type='text/css' />
    <!--//Custom Theme files -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Scott Jeremy" />
    <script src="js/underscore-noflect.js"></script>
</head>
<body>
<!-- header -->
<div class="col-md-2 sidebar">
    <div class="sidebar_top">
        <h1><a href="/">Scott<span> Jer</span></a></h1>
    </div>
    <div class="top-navigation">
        <div class="t-menu">菜单</div>

        <div class="t-img">
            <img src="images/lines.png" alt="" />
        </div>
        <div class="clearfix"> </div>
    </div>
    <div class="drop-navigation">
        <div class="top-menu">

            <ul>
                <li class="/"><a href="/">主页</a></li>
                <li><a href="/JavaScript">JavaScript</a></li>
                <li><a href="/NodeJS">NodeJS</a></li>
                <li><a href="/Environment">环境搭建</a></li>
                <li><a href="/About">关于我</a></li>
                <li><a href="/comment">留言</a></li>
            </ul>
        </div>
        <script>
            $( ".top-navigation" ).click(function() {
                $( ".drop-navigation" ).slideToggle( 300, function() {
                    // Animation complete.
                });
            });
        </script>

        <div class="side-btm">
            <div class="copyright">
                <p>Design by Scott Jeremy</p>
                <p>Copyright &copy; 2016.Scott All rights reserved.</p>
                <p><a href="#">粤ICP备16097955号-1</a></p>
            </div>
        </div>
    </div>
</div>
<div class="col-sm-10 col-sm-offset-3 col-md-10 col-md-offset-2">
    <div class="news">
        <div class="news-sec">
            <div class="news-top" id="getAllArticle">

            </div>
            <div class="col-sm-12">
                <nav>
                    <ul class="pagination">

                    </ul>
                </nav>
            </div>
        </div>
        <div class="clearfix"> </div>
    </div>
</div>
<div class="clearfix"></div>
<!---->
<script type="text/template" id="allArticle">
    <div class="col-md-11 news-1">
        <a href="/article?ID={{= ID }}"><h5>{{= topic }}</h5></a>
        <h6>{{= date }}</h6>
        <div class="post-body">
            <p> {{= content.substring(0,200).replace(/<[^>]+>/g,"") }} </p>
        </div>
        <div class="news-footer">
            <!--<h5 class="post-tags">tags:
                    <span class="tags">
                                <a href="#1">{{= classify }}</a>&nbsp;&nbsp;
                            </span>
                </h5>-->
            <h6 class="post-footer">
                分类：{{= classify }} <!--| 评论：未开放--> | 浏览：{{= visitNum }} | 点赞：{{= thumbsUp }} |
                <a href="/article?ID={{= ID }}">阅读全文 ></a>
            </h6>
        </div>
    </div>
</script>

<script type="text/javascript">
    var getAllArticle = $('#getAllArticle');
    //得到模板
    var compiled = _.template($("#allArticle").html());
    getPage(0);
    //AJAX读取文章列表
    function getPage(page) {
        $.post("/getEnvironment?page="+page,function (result) {
            for(var i = 0; i<result.allResult.length; i++){
                var htmlstring = compiled(result.allResult[i]);
                getAllArticle.append(htmlstring);
            }
        });
    }

</script>

<!---->
</body>
</html>